<?php

namespace App\Http\Controllers\Api\V1\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

class SlideResource extends JsonResource
{
    public function toArray($request)
    {
    	$data = $this->resource;
    	
        return [
        	'id' => (int)$data->id,
	        'position' => $data->position,
	        'image_url' => img_path($data->image),
	        'url' => $data->url ?? '',
	        'is_hidden' => (bool)$data->is_hidden,
	        'order' => $data->order,
	        'type' => $data->type,
	        'customer_image' => img_path($data->customer_image),
	        'created_at' => (string)$data->created_at,
        ];
    }
}
